# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         domo1011
# Description:  构造方法
# Author:       yzl
# Date:         2019-03-23
#-------------------------------------------------------------------------------

class Person:
    def __init__(self,name,age,sex):
        # 实例化第一个被调用的方法
        print('init')
        self.name = name
        self.age = age
        self.sex = sex

    def eat(self):
        print('person-->eat')
        print('吃东西')

class Student(Person):
    def __init__(self,name,age,sex,college):
        super().__init__(name,age,sex)
        self.college = college

    def eat(self,apple):
        super().eat()
        print('student-->eat')
        print(apple)

class Son(Student):
    # def eat(self,apple):
    #     super().eat(apple) # 第一行
    #     print('son-->eat')
    #     print('play....')

    def play(self):
        print('我喜欢玩游戏')


if __name__ == '__main__':
    # p = Person('zhangsan',21,'男')
    # # print(p)
    # print(p.name)
    # p.eat()

    # print('-------------------------------')
    # s = Student('lisi',20,'男','湖南工业大学')
    # print(s.name)
    # s.eat('grape')

    s = Son('xiaoming',2,'男','幼儿园')
    s.eat('milk')
    s.play()




